local skel = fk.CreateSkill {
  name = "efengqi__zhuying",
}

Fk:loadTranslationTable{
  ["efengqi__zhuying"] = "烛营",
  [":efengqi__zhuying"] = "你可以将手牌数调整至1，视为使用【火攻】或【无懈可击】",
  ["#efengqi__zhuying"] = "烛营：你可以将手牌数调整至1，视为使用【火攻】或【无懈可击】",

  ["$efengqi__zhuying1"] = "今提墨笔绘乾坤，湖海添色山永春。",
  ["$efengqi__zhuying2"] = "手提玉剑斥千军，昔日锦鲤化金龙。",
}

skel:addEffect("viewas", {
  pattern = "fire_attack,nullification",
  prompt = "#efengqi__zhuying",
  interaction = function(self, player)
    local all_names = {"fire_attack", "nullification"}
    local names = player:getViewAsCardNames(self.name, all_names)
    if #names > 0 then
      return UI.CardNameBox {choices = names, all_choices = all_names}
    end
  end,
  card_filter = function (self, player, to_select, selected, selected_targets)
    if player:getHandcardNum() > 1 then
      return #selected < player:getHandcardNum() - 1 and table.contains(player:getCardIds("h"), to_select) and
        not player:prohibitDiscard(to_select)
    else
      return false
    end
  end,
  view_as = function (self, player, cards)
    if Fk.all_card_types[self.interaction.data] == nil then return nil end
    local card = Fk:cloneCard(self.interaction.data)
    card.skillName = self.name
    if player:getHandcardNum() > 1 then
      if #cards ~= (player:getHandcardNum() - 1) then return end
      card:addFakeSubcards(cards)
    else
      if #cards > 0 then return end
    end
    return card
  end,
  before_use = function (self, player, use)
    local room = player.room
    if use.card.fake_subcards and #use.card.fake_subcards > 0 then
      room:throwCard(use.card.fake_subcards, self.name, player, player)
    else
      player:drawCards(1, self.name)
    end
  end,
  enabled_at_play = function(self, player)
    return player:getHandcardNum() ~= 1
  end,
  enabled_at_response = function(self, player, response)
    return not response and player:getHandcardNum() ~= 1
  end,
})



return skel
